<%--
  Created by IntelliJ IDEA.
  User: wyz
  Date: 2024/10/15
  Time: 21:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%request.setCharacterEncoding("GBK");%>
<jsp:useBean id="ps" class="javabean.Person" scope="page" />
<!-- 在这里因为前面form中的name sex age 和javabean 中一样 所以进行了自动匹配 property=“*” 表示匹配的属性是所有的 -->
<jsp:setProperty name="ps" property="*" />
姓名:<jsp:getProperty name="ps" property="name"/><br>
性别:<jsp:getProperty name="ps" property="sex"/><br>
年龄:<jsp:getProperty name="ps" property="age"/><br>
</body>
</html>